<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:72:"D:\phpStudy\WWW\ferr\public/../application/wechat\view\cons\oreview.html";i:1493799379;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <title>订单审核</title>
    <link rel="stylesheet" href="__CSS__/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/hdw.css">
    <link rel="stylesheet" href="__CSS__/reset.css">
    <link rel="stylesheet" href="__CSS__/common.css">
    <link rel="stylesheet" href="__CSS__/wechat/cons.css">
    <link rel="stylesheet" type="text/css" href="__CSS__/mobiscroll.custom-2.5.2.min.css">
    <script src="__JS__/vue.js"></script>
    <script src="__JS__/libs/jquery-2.0.2.min.js"></script>
    <script src="__JS__/bootstrap/bootstrap.min.js"></script>
    <script src="__JS__/hdw.js"></script>
    <script src="__JS__/mobiscroll.custom-2.5.2.min.js""></script>    
    <style>    	
     	#contentBox .navBox{
     		height: 44px;
     		line-height: 44px;
     		text-align: center;
    		font-size: 18px;
    		background: #fff;
    		color: #000;
    		position: fixed;
		    z-index: 1000;
		    top: 0;
       	}
     	#contentBox{     		
     		padding-top: 44px;
     	}
     	.history_back {
		    background: url("__IMG__/wechat/back.png") no-repeat;
		    background-size: cover;
		    position: absolute;
		    top: 0;
		    left: 0;
		    height: 44px;
		    width: 44px;
		}
     	.outer{     		
     		overflow: auto;
     		/*border-bottom: 1px solid #ddd;*/
     		background: #fff;
     		margin-top:10px;
     	}
     	.outer p{
     		font-size: 17px;
     		font-weight: 500;
     		padding: 0 20px;
		    height: 25px;
		    line-height: 25px;
		    /*background: aliceblue;*/
		    /*color: darkseagreen;*/
		    background: #FC866F;
    		color: #fff;
     	}
     	
     	.line{     		
     		 border-bottom: 1px solid #ddd; 
     		 padding: 4px 20px;
     	}
     	.lineleft,.lineright{     	
		    min-height:22px;
		    line-height: 22px;
		    overflow: auto;
		    font-size: 15px;
     	}     	
     	.lineleft span:first-child,.lineright span:first-child{
     		float: left;
     	}
     	.lineleft span:last-child,.lineright span:last-child,.contract{
     		float: right;
     	}
     	.contract{
     		width:30vw;
     		height:40vw;
     	}
     	#all{
     		position: relative;
     	}
     	.bigimg{
     		height: 100vh;
     		width: 100vw;
     		position: absolute;
     	}
     	.bigimg img{
     		display: block;
     		width: 70vw;
     		height: 80vh;
     		margin: 10vh auto;
     	}
     	.tableinfo{
     		width: 100%;
     	}
     	.tableinfo th,.tableinfo td{
     		height: 26px;
     		text-align: center;
     		line-height: 26px;
     		border:1px solid #ccc;
     		font-size: 14px;
     	}
     	.tableinfo th{
     		height: 28px;
     		font-size: 15px;
     		line-height: 28px;
     		background: #efefef;
     	}
     	.color_dred{
     		color: darkred;
     	}
     	.submit1{
     		    width: 90%;
			    height: 40px;
			    margin:10px 0 0 5%;
			    background: #286090;
			    color: white;
			    border: none;
			    border-radius: 5px;
			    margin-bottom: 30px;
     	}
     	.black_bg{
     		height: 100%;
     		width: 100%;
     		position: fixed;
     		left: 0;
     		top: 0;
     		background: rgba(0,0,0,.3);
     		z-index: 1001;
     	}
     	.sub_max{
     		max-height:600px;
     		width: 70%;
     		margin-left: 15%;
     		margin-top:40px ;
     		background: white;
     		overflow: auto;
     	}
     	.sub_con{
     		min-height:150px;
     		width: 100%;
     		background: white;
     		border:1px solid #ccc;
     	}
     	.sub_con .p_div,.sub_con .m_div,.sub_con .b_div{
     		width: 98%;
     		min-height: 50px;
     		padding:4px 1%;
     	}
     	.sub_con .p_div{
     		position: relative;
     	}
     	.sub_con div label{
     		width: 100%;
     		height: 20px;
     	}
     	.P_input{
     		width: 100%;
     		height: 28px;
     		position: absolute;
     		left: 0;
     		top: 5px;
     	}
     	.m_textare{
     		width: 100%;
     		height:70px ;
     		padding:2px;
     	}
     	.addP{
     		width: 50%;
     		height: 30px;
     		background: #286090;
     		color: white;
     		border:0;
     		border-radius: 3px;
     	}
     	.btn_sub,.btn_back{
     		padding:6px 8px;
     	}
    </style>
</head>
<body >	
	<div id="all">	
		<div class="black_bg" v-if="black_bg">
			<div class="sub_max">
				<div class="sub_con">
					<div v-for="(list,index) in lists">
						<div class="p_div" v-if="type1">
							<label for="">咨询人</label>
						<!--	<input type="text" class="P_input" v-bind="list.id"/>-->
							<select name="" style="padding:0;margin: 0;width: 100%;height: 28px;" v-model="list.id" class="test_3"></select>
						</div>
						<div class="m_div">
							<label for="">资讯信息</label>
							<textarea name="" rows="" cols="" class="m_textare" v-model="list.note"></textarea>
						</div>
						<div style="height: 30px;width: 96%;" v-if="type1">
							<button class="remove" style="padding:1px 3px;float: right;" @click="remove(index)">删除</button>
						</div>
					</div>								
					<div class="b_div">
						<button class="addP" v-if="type1" @click="addp(lists)">添加征询人</button>					
						<button @click="close" class="btn_back">取消</button>
						<button class="btn_sub" @click="btnsub(typeval)">提交</button>
					</div>
				</div>				
			</div>
			
		</div>		
		<div id="contentBox">
		    <nav class="navBox">
		        <span>订单审核</span>        
		    </nav>
		    <div class="mainContent">
				<div class="outer One" >			
					<div class="right">
						<p>基本情况</p>	
						<div class="line">
							<div class="lineleft">
								<span>申请人</span>
								<span>{{create.name}}</span>						
							</div>
						</div>
						<div class="line">
							<div class="lineleft">
								<span>申请人职务</span>
								<span>{{create.duty}}</span>
							</div>	
						</div>	
						<div class="line">
							<div class="lineleft">
								<span>负责人</span>
								<span>{{charge.name}}</span>						
							</div>
						</div>
						<div class="line">
							<div class="lineleft">
								<span>负责人职务</span>
								<span>{{charge.duty}}</span>
							</div>	
						</div>
						<div class="line">
							<div class="lineleft">
								<span>时间</span>
								<span>{{order.time | timetrans(1)}}</span>
							</div>	
						</div>
					</div>
				</div>
				<div class="outer One">			
					<div class="right">
						<p>详情</p>			
						<div class="line">
							<div class="lineleft">
								<span>订单编号</span>
								<span>{{order.order_no}}</span>						
							</div>
						</div>
						<table class="tableinfo">
							<tr>
								<th>商品名称</th>
								<th>商品规格</th>
								<th>商品类型</th>
								<th>商品单价</th>
								<th>商品数量</th>
							</tr>
							<tr v-for="list in goods">
								<td>{{list.name}}</td>
								<td>{{list.standard}}</td>
								<td>{{list.type}}</td>
								<td>{{list.price}}</td>
								<td>{{list.num}}</td>
							</tr>
						</table>
						<div class="line">
							<div class="lineright">
								<span>地址:</span>
								<span>{{order.addr}}</span>
							</div>
						</div>
						<div class="line">
							<div class="lineright">
								<span>备注:</span>
								<span>{{order.note}}</span>
							</div>
						</div>
						<div class="line">
							<div class="lineright">
								<span></span>
								<span>总价:&nbsp;&nbsp;<span class="color_dred">￥{{order.acamount}}</span></span>
							</div>
						</div>
						
					</div>
				</div>
				<div class="outer One">			
					<div class="right">
						<p>操作</p>			
						<div class="line">
							<div class="lineright" style="padding: 5px 0;">
								<span @click="open(1)" style="width: 50%;"><button style="width: 80%;">重修</button></span>
								<span @click="open(2)" style="width: 50%;"><button style="width: 80%;float: right;">返修</button></span>
							</div>
						</div>						
						<div class="line">
							<div class="lineright" style="padding: 5px 0;">
								<span @click="open(3)" style="width: 50%;"><button style="width: 80%;">征询</button></span>
								<span @click="open(4)" style="width: 50%;"><button style="width: 80%;float: right;">抄送</button></span>
							</div>
						</div>
						
					</div>
				</div>
				<div class="outer three">			
					<div class="right">
						<p>审核</p>
						<div class="line"  v-if="!noteshow">
							<div class="lineleft">
								<span>审核进度</span>
								<span>{{jury.curStep}}/{{jury.steps}}</span>						
							</div>					
						</div>
						<div class="line">
							<div class="lineright">
								<span>结果:</span>
								<span><button class="" style="margin-right: 18px;padding:0px 8px;">通过</button><button style="padding:0px 8px;">不通过</button></span>
							</div>				
						</div>							
						<div class="line" v-if="noteshow">
							<div class="lineright">
								<span style="width: 15%;">意见：</span>
								<textarea name="" style="width: 80%;height: 60px;margin-left: 5%;"></textarea>
							</div>				
						</div>
											
					</div>
				</div>
				<button class="submit1">提交</div>
		    </div>
		</div>
	</div>
	
<script>
	$(window).load(function() {
		//发送对象、加载
		
	})
	
	
	
	
	Vue.filter("timetrans",function(date,type){
        var date = new Date(date*1000);//如果date为10位不需要乘1000
        var Y = date.getFullYear();
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
        var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
        var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes());
        var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());        
        if(type==1){
          return Y+"/"+M+"/"+D+" "+h+":"+m+":"+s;
        }else if(type==2){
          return Y+"/"+M+"/"+D;
        } else if(type==3){
          return M+"/"+D+" "+h+":"+m;
        }     
      });
      
     var str=location.href;
	var str=str.split("id/")[1];
	var ids=str.split(".html")[0];
    var vm = new Vue({
        el:"#all",
        data:{
        	show:false,
        	base:[],
        	charge:[],
        	create:[],
        	goods:[],
        	order:[],
        	jury:[],
        	result:"",
        	noteshow:true,
        	juryMan:[],
        	black_bg:false,
        	type1:false,
//      	p_input:"",
//      	note:"",
        	typeval:1,
        	lists:[
        	{id:"",note:""},
        	]
        },
        methods:{
        	//关闭
        	close:function(){
        		this.lists.splice(1, 6);
        		this.black_bg=false;					
        	},
        	//增加
        	addp:function(lists){       		
        		var attra={id:"",note:""};
        		this.lists.push(attra);
        		$.ajax({
				type: "post",
				url: "<?php echo url('manage/Order/getresponseinfo'); ?>",
				data: {
					type: "0",
				},
				success: function(data) {
					var data = JSON.parse(data);
					var data = data.data;
					var len = data.length;
					for(var i = 0; i < len; i++) {
						var options = `
	    				<option value="${data[i].uid}" class="option3" onclick="addtext()" imgPath="https://select2.github.io/vendor/images/flags/ak.png">${data[i].name}+${data[i].rname}</option>        			
	    			`;
						$(".test_3").append($(options));
					}
					for(var i = 0; i < len; i++) {
						var options = `
	    				<option value="${data[i].uid}" class="option4" imgPath="https://select2.github.io/vendor/images/flags/ak.png">${data[i].name}+${data[i].rname}</option>        			
	    			`;
						$(".test_4").append($(options));
					}
				}
			})
        	},
        	//移除
        	remove:function(index){
        		this.lists.splice(index, 1);
        	},
        	//btn 点击
          	open:function(data){
          		this.typeval=data;
          		this.black_bg=true;
          		if(data==4){
          			this.type1=true;
          		}else if(data==3){
          			this.type1=true;
          		}else if(data==2){
          			this.type1=false;
          		}else if(data==1){
          			this.type1=false;
          		}
          	},
          	btnsub:function(data){
          		var urlT="<?php echo url('manage/Affairorder/processAffair'); ?>";
          		var note=this.lists[0].note;
          		var injueryId=this.lists;
          	//重修
          		if(data==1){
          			var data={
          				id:ids,
          				note:note,
          				action:"rework"
          			};
          	//返修		
          		}else if(data==2){          			
          			var data={
          				id:ids,
          				note:note,
          				action:"modify"
          			};
          	//		
          		}else if(data==3){
          			var data={
          				id:ids,
          				injueryId: injueryId,
          				action:"inquiry"
          			};
          		}
          		else if(data==4){
          			var data={
          				id:ids,
          				action:"copy",
          				injueryId: injueryId
          			};
          		}
          		$.ajax({
          			type:"post",
          			url:urlT,
          			data:data,
          			success:function(data){
          				var data=JSON.parse(data);
          				if(data.status==1){
          					alert("提交成功！");
          				}else{
          					alert(data.message);
          				}
          			}
          		});
          	}
        },
        created(){        	
        	var _this=this;
        	$.ajax({
        		type:"post",
        		data:{
        			id:ids
        		},
        		url:"<?php echo url('manage/Affairorder/orderDetailData'); ?>",
        		success:function(data){
        			var data=JSON.parse(data);
        			var data=data.data;
        			_this.base=data.base;
        			_this.charge=_this.base.charge;
        			_this.create=_this.base.create;
        			_this.jury=data.jury;
        			//y
        			var order=data.order;
        			console.log(data)
        			_this.order=order;
        			_this.goods=order.goods;
        			if(_this.jury.type==-1){
        				_this.result="处理中";
        				_this.noteshow=false;
        			}else if(_this.jury.type==0){
        				_this.result="未通过";
        			}else if(_this.jury.type==1){
        				_this.result="通过";
        			}        			       			        			
        		}
        	})
      	},
       
    })   
</script>
</body>
</html>